// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#ifndef WORK_LOGQUEUE_H
#define WORK_LOGQUEUE_H

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#define MYSQLPP_MYSQL_HEADERS_BURIED
#include <mysql++/mysql++.h>

#include <IceUtil/IceUtil.h>

#include <list>

#include<string>
#include<iostream>
#include<map>
#include<iterator>

using namespace std;

class MylogWorkQueue : public IceUtil::Thread
{
public:

    MylogWorkQueue();

    virtual void run();

    void add(const std::string&);
    void destroy();

    mysqlpp::Connection con;
private:

    struct MylogQueue
    {
	std::string ClientInfo;
    };


    map<string,int> m_ClientIp; 

    IceUtil::Monitor<IceUtil::Mutex> _monitor;
    std::list<MylogQueue> _mylogqueue;
    bool _done;
};

typedef IceUtil::Handle<MylogWorkQueue> MylogWorkQueuePtr;

#endif

